    <!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>塞纳皇宫-网站后台管理系统</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="icon" href="/static/admin/img/logo.png" type="image/x-icon">
    <link rel="shortcut icon" href="favicon.ico"> <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="/static/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">


    <script src="/static/admin/editor/ueditor.config.js"></script>
    <script src="/static/admin/editor/ueditor.all.js"></script>
    <link href="/static/admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <script src="/static/admin/js/city/jquery-1.11.3.min.js"></script>

    <!-- 全局/static/admin//static/admin//static/admin/js -->
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- 自定义js -->
    <script src="/static/admin/js/content.js?v=1.0.0"></script>
    <!-- jQuery Validation plugin javascript-->
    <!-- <script src="/static/admin/js/plugins/validate/jquery.validate.min.js"></script>-->
    <!--<script src="/static/admin/js/plugins/validate/messages_zh.min.js"></script>-->
    <!--<script src="/static/admin/js/demo/form-validate-demo.js"></script>-->
    <script src="/static/admin/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>

    <!--script src="/static/admin/layer/layer.css"></script>-->
    <script src="/static/admin/layer/layer.js"></script>
    <style>
        .select—sou{float:left; width: 150px; height: 30px; margin-left: 10px; font-size: 12px;z-index: 3;}
        .sousuo{float:left; margin-left: 10px; }

    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>获选作品 </h5>

                    </div>
                    <div class="ibox-content" style="position: relative">
                        <div class="">
                            <a onclick="fnClickAddRow();" href="javascript:void(0);" class="btn btn-primary ">添加作品</a>
                        </div>
                        <div class="row" style="position:absolute;left: 198px;z-index: 3;width: 1200px;  ">

                        </div>

                        <table class="table table-striped table-bordered table-hover dataTables-example">

                            <thead>
                                <tr>
                                    <th>排序</th>
                                    <th>标题</th>
                                    <th>主图</th>
                                    <th>点击量</th>
                                    <th>拍摄时间</th>
                                    <th>状态</th>
                                    <th>发布时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {volist name="data" id="v"}
                                <tr class="gradeX">
                                    <td ><input style="width: 40px;-webkit-appearance: none;" type="text" onblur="changeSort({$v.id})" name="sort_{$v.id}" value="{$v.sort}"></td>
                                    <td><a title="点击查看" target="_blank" href="http://test.andbrand.com.cn/guest/hx/id/{$v.id}.html">{$v.title}</a></td>
                                    <td><img width="60" height="70;" src="{$v.main_img}"></td>
                                     <td class="center">{$v.click}</td>
                                    <td class="center">{if $v.ps_time >0}{$v.ps_time|date='Y-m-d',###}{/if}</td>
                                    <td class="center">{if $v.is_show==1}显示{else}不显示{/if}</td>
                                    <td class="center">{if $v.create_time >0}{$v.create_time|date='Y-m-d H:i:s',###}{/if}</td>
                                    <td class="center"><a href="javascript:;" onclick="edit({$v.id})">编辑</a>&nbsp;&nbsp;&nbsp;
                                        <a href="javascript:;" onclick="del(this,{$v.id})">删除</a></td>
                                </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <!--<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>-->
    <!--<script src="/static/admin/js/plugins/jeditable/jquery.jeditable.js"></script>-->
    <!-- Data Tables -->
    <script src="/static/admin/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="/static/admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <!-- 自定义js -->
    <script src="/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/static/admin/layer/layer.js"></script>
    <!-- Page-Level Scripts -->
    <script>

        function fnClickAddRow() {
            window.location.href="/admin.php/Works/add_hx";
        }
        //编辑
        function edit(id){
            window.location.href="/admin.php/Works/edit_hx?id="+id;
        }
        //删除
        function del(obj,id){
            layer.confirm('确认要删除吗？',function(){
                $.post("/admin.php/Works/hxdel",{id:id},function(e){
                    if(1==e.code){
                        layer.msg(e.msg);
                        $(obj).parents("tr").remove();
                    }else{
                        layer.msg(e.msg);
                    }
                 },'json')
            });
        }
        //排序
        function changeSort(id){
            var sort_name = 'sort_'+id+'';
            var new_sort = $("input[name='"+sort_name+"']").val();
            if(isNaN(new_sort)){
                layer.msg('必须是数字');
                return false;
            }
            $.post("/admin.php/Works/ChangehxSort",{sort:new_sort,id:id},function(e){
                if(1 == e.code){
                    layer.msg(e.msg);
                    window.location.reload();
                }else{
                    alyer.msg(e.msg);
                    return false;
                }
            })
        }
    </script>

    
    

</body>

</html>
